<?php

require_once './include/common.inc.php';
require_once 'left.php';
require_once 'right.php';

$page_title = 'Acuity World WebShop';
$menu_id = 0;
$menu_str = PrintMenu();


$searchtext = $_POST['psearch'];

$sql_where = '';
if ($_POST['act'] == "search") {
    $sql_where = " (`firstname` LIKE '%$searchtext%' OR `lastname` LIKE '%$searchtext%') AND ";
}

$sql = "SELECT * FROM `promoter_info` WHERE $sql_where `status` = '1'  ";
$query = $db->query($sql);
while($rs = $db->fetch_array($query)) {

    if ($_POST['act'] == "search") {
        $rs['firstname'] = str_replace($searchtext, "<font color=red>$searchtext</font>", $rs['firstname']);
        $rs['lastname'] = str_replace($searchtext, "<font color=red>$searchtext</font>", $rs['lastname']);
    }
    $promoter_list_ary[$rs['id']] = $rs;
    
}

$total = count($promoter_list_ary);

require_once PrintEot('header');
require_once PrintEot('left');
require_once PrintEot('promoter_list');
require_once PrintEot('right');
require_once PrintEot('footer');

?>